<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>产品详情</title>
<link rel="stylesheet" type="text/css" href="css/product.css">
<link rel="stylesheet" href="layui/css/layui.css" media="all" />
<script src="layui/layui.all.js"></script>
<!--[if it IE 9]>
	<script src="html5shiv/html5shiv.js"></script>
    <script src="respond/respond.js"></script>
<![end if]-->

<script src="jq/jquery.min.1.11.js"></script>
</head>
<script type="text/javascript">
$(document).ready(function(){
	// 图片上下滚动
	var count = $("#imageMenu li").length - 5; /* 显示 6 个 li标签内容 */
	var interval = $("#imageMenu li:first").width();
	var curIndex = 0;
	
	$('.scrollbutton').click(function(){
		if( $(this).hasClass('disabled') ) return false;
		
		if ($(this).hasClass('smallImgUp')) --curIndex;
		else ++curIndex;		
		$("#imageMenu ul").stop(false, true).animate({"marginLeft" : -curIndex*interval + "px"}, 600);
	});	
	// 解决 ie6 select框 问题
	$.fn.decorateIframe = function(options) {
        if ($.browser.msie && $.browser.version < 7) {
            var opts = $.extend({}, $.fn.decorateIframe.defaults, options);
            $(this).each(function() {
                var $myThis = $(this);
                //创建一个IFRAME
                var divIframe = $("<iframe />");
                divIframe.attr("id", opts.iframeId);
                divIframe.css("position", "absolute");
                divIframe.css("display", "none");
                divIframe.css("display", "block");
                divIframe.css("z-index", opts.iframeZIndex);
                divIframe.css("border");
                divIframe.css("top", "0");
                divIframe.css("left", "0");
                if (opts.width == 0) {
                    divIframe.css("width", $myThis.width() + parseInt($myThis.css("padding")) * 2 + "px");
                }
                if (opts.height == 0) {
                    divIframe.css("height", $myThis.height() + parseInt($myThis.css("padding")) * 2 + "px");
                }
                divIframe.css("filter", "mask(color=#fff)");
                $myThis.append(divIframe);
            });
        }
    }
    $.fn.decorateIframe.defaults = {
        iframeId: "decorateIframe1",
        iframeZIndex: -1,
        width: 0,
        height: 0
    }
    //放大镜视窗
    $("#bigView").decorateIframe();
    //点击到中图
    var midChangeHandler = null;
	
    $("#imageMenu li img").bind("click", function(){
		if ($(this).attr("id") != "onlickImg") {
			midChange($(this).attr("src").replace("small", "mid"));
			$("#imageMenu li").removeAttr("id");
			$(this).parent().attr("id", "onlickImg");
		}
	}).bind("mouseover", function(){
		if ($(this).attr("id") != "onlickImg") {
			window.clearTimeout(midChangeHandler);
			midChange($(this).attr("src").replace("small", "mid"));
			$(this).css({ "border": "3px solid #959595" });
		}
	}).bind("mouseout", function(){
		if($(this).attr("id") != "onlickImg"){
			$(this).removeAttr("style");
			midChangeHandler = window.setTimeout(function(){
				midChange($("#onlickImg img").attr("src").replace("small", "mid"));
			}, 1000);
		}
	});
    function midChange(src) {
        $("#midimg").attr("src", src).load(function() {
            changeViewImg();
        });
    }
    //大视窗看图
    function mouseover(e) {
        if ($("#winSelector").css("display") == "none") {
            $("#winSelector,#bigView").show();
        }
        $("#winSelector").css(fixedPosition(e));
        e.stopPropagation();
    }
    function mouseOut(e) {
        if ($("#winSelector").css("display") != "none") {
            $("#winSelector,#bigView").hide();
        }
        e.stopPropagation();
    }
    $("#midimg").mouseover(mouseover); //中图事件
    $("#midimg,#winSelector").mousemove(mouseover).mouseout(mouseOut); //选择器事件

    var $divWidth = $("#winSelector").width(); //选择器宽度
    var $divHeight = $("#winSelector").height(); //选择器高度
    var $imgWidth = $("#midimg").width(); //中图宽度
    var $imgHeight = $("#midimg").height(); //中图高度
    var $viewImgWidth = $viewImgHeight = $height = null; //IE加载后才能得到 大图宽度 大图高度 大图视窗高度

    function changeViewImg() {
        $("#bigView img").attr("src", $("#midimg").attr("src").replace("mid", "big"));
    }
    changeViewImg();
    $("#bigView").scrollLeft(0).scrollTop(0);
    function fixedPosition(e) {
        if (e == null) {
            return;
        }
        var $imgLeft = $("#midimg").offset().left; //中图左边距
        var $imgTop = $("#midimg").offset().top; //中图上边距
        X = e.pageX - $imgLeft - $divWidth / 2; //selector顶点坐标 X
        Y = e.pageY - $imgTop - $divHeight / 2; //selector顶点坐标 Y
        X = X < 0 ? 0 : X;
        Y = Y < 0 ? 0 : Y;
        X = X + $divWidth > $imgWidth ? $imgWidth - $divWidth : X;
        Y = Y + $divHeight > $imgHeight ? $imgHeight - $divHeight : Y;

        if ($viewImgWidth == null) {
            $viewImgWidth = $("#bigView img").outerWidth();
            $viewImgHeight = $("#bigView img").height();
            if ($viewImgWidth < 200 || $viewImgHeight < 200) {
                $viewImgWidth = $viewImgHeight = 800;
            }
            $height = $divHeight * $viewImgHeight / $imgHeight;
            $("#bigView").width($divWidth * $viewImgWidth / $imgWidth);
            $("#bigView").height($height);
        }
        var scrollX = X * $viewImgWidth / $imgWidth;
        var scrollY = Y * $viewImgHeight / $imgHeight;
        $("#bigView img").css({ "left": scrollX * -1, "top": scrollY * -1 });
        $("#bigView").css({ "top": 480, "left": $(".preview").offset().left + $(".preview").width() + 45 });

        return { left: X, top: Y };
    }
  /**
             * click  outline,衣服规格
             */
            var $clothType = $('.cloth_type').children('li');
            var $colorType = $('.color_type');
            $clothType.click(function () {
                var that = $(this);
                $clothType.css('outline' , 'none');
                select_line(that)
            });
            $colorType.click(function () {
                var that = $(this);
                $colorType.css('outline' , 'none');
                select_line(that)
            });

 			/**
             * input value购买数量
             */

            $('#des_num').val(1);
            $num = $('#des_num').val();
            var $up = $('#num_up');
            var $down = $('#num_down');

            $up.click(function () {inputNum(1)});
            $down.click(function () {inputNum(-1)});

        function select_line(a1) {
            a1.css('outline' , 'none');
            a1.css('outline' , '#8aa8e5 2px solid');
        }

        function inputNum(a1) {
            var a2 = parseInt(a1);
            $num = parseInt($num);
            $num += a2;
            if ($num > 0){
                $('#des_num').val($num);
            }else {
                $num = 1;
            }
        }
});
</script>
<body>
<!---head--------->
	<div class="header">
    	<div class="box">
        	<div class="title">
            	<img class="images01" src="images/logo01.jpg" alt="这是一张图片">
                <a href="index.html"><div>琴行首页</div></a>
                <a href="user.html"><p><span id ="name1"></span></p></a>
                <a href="#"><p>消息</p></a>
                <a href="orders.html"><p><img src="images/logo02.jpg">我的订单</p></a>
                <a href="shopping.html"><p><img src="images/logo03.jpg">收藏篮</p></a>
            </div>
        </div>
	</div>
<!---产品------------------------------>
	<div class="products">
    	<div class="preview">
        	<div id="vertical" class="bigImg">
            	<!--里边放图片-->
        	</div>        			
        	<div class="smallImg">
            	<div class="scrollbutton smallImgUp disabled"></div>
        	</div>
        	<div id="bigView" style="display:none;"><img width="800" height="800" alt="" src="" />
        	</div>
    	</div>
        <div class="product">
        	<div class="words" id="shangpinmingcheng">
            	
            </div>
        	<div class="words01" id="jiage">
            	
            </div>
            <div class="words02">
            	<p>客服：</p>
                <input name="联系客服" type="button" value="联系客服">
            </div>
            
            <div class="words05">
            	<p>数量：</p>
                <div id="num_down">-</div> 
                <input id="des_num" name="1" type="tel" value="1">
                <div id="num_up">+</div>
            </div>
            <div class="words06" id="words06">
            	<!--<input class="goumai" name="立即购买" type="button" value="立即购买">
                <input class="gouwuche" name="加入购物车" type="button" value="加入购物车">-->
            </div>
            <ul class="words07">
            	<li>服务承诺</li>
            	<li>正品保证</li>
                <li>七天无理由退款</li>
                <li>全国包邮</li>
            </ul>
            <div class="words08">
            	<p>支付方式：</p>
                <img src="images/logozhifu.jpg" alt="这是一张图片">
            </div>
        </div>
	</div>
<!---商品详情---------->
	<div class="titles">
    	<div class="bei_jing">
        	<h1>商品详情</h1>
        </div>
        <p>品牌名称：<span id="pinpai"></span></p>
        <p>颜色:<span id="color"></span> </p>
        <p>产地:<span id="producePlace"></span> </p>
        <p>生产日期:<span id="produceTime"></span> </p>
        <p>音色:<span id="timbre"></span> </p>
    </div>
    
    <div class="titles">
    	<div class="bei_jing">
        	<h1>交流</h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        	<h1 id="liuyan111">留言</h1>
     </div>
        <div id="liuyan">
        	<!--<div class="yiji">
        		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red; font-size:6px;"> wjs 已买：</span><span id="">商品很好</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="">回复</span><br />
        	</div>
        	<div class="erji">
        		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red; font-size:6px;"> wjs回复wyz 未买：</span><span id="">有多好</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="">回复</span>
        	</div>-->
        </div>
        
    </div>

<!---foot-------->
    <div class="footer01">
            <div class="footerBox">
                <img src="images/logo.jpg" alt="这是一张图片">
                <div class="footerCon01">
                    <ul class="foot01">
                        <li><a href="#"><span>公司</span></a></li>
                        <li><a href="#">关于我们</a></li>
                        <li><a href="#">招聘信息</a></li>
                        <li><a href="#">联系我们</a></li>
                    </ul>
                </div>
                <div class="footerCon02">
                    <ul class="foot02">
                        <li><a href="#"><span>消费者</span></a></li>
                        <li><a href="#">消费者服务</a></li>
                        <li><a href="#">意见反馈</a></li>
                        <li><a href="#">手机版下载</a></li>
                    </ul>
                </div>
                <div class="footerCon03">
                    <ul class="foot03">
                        <li><a href="#"><span>支付方式</span></a></li>
                        <li><a href="#">快捷支付</a></li>
                        <li><a href="#">银联支付</a></li>
                        <li><a href="#">微信支付</a></li>
                        <input type="button" name="" id="" value="" />
                    </ul>
                </div>
                <div class="footerCon04">
                    <ul class="foot04">
                        <li><a href="#"><span>商家服务</span></a></li>
                        <li><a href="#">商家入驻</a></li>
                        <li><a href="#">商家中心</a></li>
                        <li><a href="#">运营服务</a></li>
                    </ul>
                </div>
                <div class="footerCon05">
                    <ul class="foot05">
                        <li><a href="#"><span>手机商城</span></a></li>
                    </ul>
                    <div class="erWeiMa"></div>
                </div>
            </div>
        </div>
    <div class="footer02">
    	<p>营业执照注册号：330106000129004   增值电信业务经营许可证：鲁B2-20110349  网络文化经营许可证：鲁网文（2016）0349-219号  
安全责任书 鲁公网安备 33010602002329号——林杨工作室</p>
	</div>
</body>
<script type="text/javascript">
	var id = location.href.split("=")[1];
	var start = location.href.split("=")[2];
	
	
	//从session中取出信息放入个人信息那
	$("#name1").text(sessionStorage.getItem("userName"));
	console.log(sessionStorage.getItem("userinfo"));
	
	var userid = sessionStorage.getItem("userid");
	var guitarname = "";
	var guitarid = "";
	var prace = "";
	
	var guitarphoto = "";
	var color = "";
	var goodsType = "";
	//alert(start);
	
	if(start == 0){
		$.ajax({
			type:"get",
			url:"http://127.0.0.1/yh/selectOneGuitarInfo",
			async:false ,
			data:{"id":id},
			dataType:"json",
			success:function(data){
				if(data.code==0){
					guitarname=data.data.name;
					guitarid=data.data.id;
					prace=data.data.price;
					guitarphoto=data.data.photo;
					color=data.data.color;
					goodsType=0;
					var photoStr = 	'<img src="'+data.data.photo+'" width="400" height="400" alt="" id="midimg" />'+
            						'<div style="display:none;" id="winSelector">'+
            						'</div>';
        				
        			
        			var words01 = 	'<h1>价格：<span>￥'+(data.data.price+200)+'</span></h1>'+
               						'<p>促销价：<span>￥'+data.data.price+'</span></p>';
               		
               		var shangpinmingcheng = '<p style="color: burlywood;">商品名称：</p>'+data.data.name;
               		
               		var words06 =	'<input class="goumai" name="立即购买" type="button" value="立即购买">'+
                					'<input class="gouwuche" name="加入收藏" type="button" value="加入收藏">';
                	$("#words06").html(words06);
               		$("#jiage").html(words01);	
        			$("#vertical").html(photoStr);
        			$("#shangpinmingcheng").html(shangpinmingcheng);	
               		
               		//商品详情
               		$("#pinpai").text(data.data.brand);
               		$("#color").text(data.data.color);
               		$("#producePlace").text(data.data.producePlace);
               		$("#produceTime").text(data.data.produceTime);
               		$("#timbre").text(data.data.timbre);
        			
        			
				}
			}
		});
		
	}else if(start==1){
		
		$.ajax({
			type:"get",
			url:"http://127.0.0.1/yh/selectOneRecommend_guitar",
			async:false,
			data:{"id":id},
			dataType:"json",
			success:function(data){
				
					guitarname=data.data.name;
					guitarid=data.data.id;
					prace=data.data.price;
					guitarphoto=data.data.photo;
					color=data.data.color;
					goodsType=1;
				
					var photoStr = 	'<img src="'+data.data.photo+'" width="400" height="400" alt="" id="midimg" />'+
            						'<div style="display:none;" id="winSelector">'+
            						'</div>';
        				
        			
        			var words01 = 	'<h1>价格：<span>￥'+(data.data.price+200)+'</span></h1>'+
               						'<p>促销价：<span>￥'+data.data.price+'</span></p>';
               		
               		var shangpinmingcheng = '<p style="color: burlywood;">商品名称：</p>'+data.data.name;
               		var words06 =	'<input class="goumai" name="立即购买" type="button" value="立即购买">'+
                					'<input class="gouwuche" name="加入收藏" type="button" value="加入收藏">';
                	$("#words06").html(words06);
               		$("#jiage").html(words01);	
        			$("#vertical").html(photoStr);
        			$("#shangpinmingcheng").html(shangpinmingcheng);
        			
        			//商品详情
               		$("#pinpai").text(data.data.brand);
               		$("#color").text(data.data.color);
               		$("#producePlace").text(data.data.producePlace);
               		$("#produceTime").text(data.data.produceTime);
               		$("#timbre").text(data.data.timbre);
			}
		});		
	}
	
	
	
	//支付的点击事件
	$(".words06").delegate(".goumai","click",function(){
		var count = $("#des_num").val();
		$.ajax({
			type:"post",
			url:"http://127.0.0.1/yh/insertOrderInfo",
			async:true,
			data:{
				"userid":userid,
				"guitarname":guitarname,
				"guitarid":guitarid,
				"prace":prace,
				"count":count,
				"guitarphoto":guitarphoto,
				"color":color,
				"goodsType":goodsType
			},
			dataType:"json",
			success:function(data){
				if(data.code==0){
					//id商品id+那个表+数量
					window.location.href="pay.html?id="+id+"="+start+"="+$("#des_num").val()+"="+data.data+"=";
				}else{
					alert(data.msg);
				}
			}
		});
		
		
	})
	
	
	//加入购物车的点击事件
	
	$(".words06").delegate(".gouwuche","click",function(){
		//alert("点到购物车了")
		var count = $("#des_num").val();
		$.ajax({
			type:"post",
			url:"http://127.0.0.1/yh/insertShoppingCart",
			async:true,
			data:{
				"userid":userid,
				"guitarname":guitarname,
				"guitarid":guitarid,
				"goodsType":goodsType,
				"color":color,
				"count":count,
				"guitarphoto":guitarphoto,
				"price":prace
			},
			dataType:"json",
			success:function(data){
				if(data.code==0){
					layer.msg(data.msg, {
 							icon: 1,
  							time: 2000 //2秒关闭（如果不配置，默认是3秒）
							}, function(){
  								window.location.href="index.html";
							}); 
				}else{
					layer.msg(data.msg); 
				}
			}
		});
	})
	
	
	
	
	//关于在线交流的
	//查询所有留言
	$.ajax({
			type:"get",
			url:"http://127.0.0.1/yh/selectAllMessage",
			async:false,
			data:{
				"guitarinfoname":guitarname
			},
			dataType:"json",
			success:function(data){
				if(data.code==0){
					var str = "";
					for (var i = 0; i < data.data.length; i++) {
						if(data.data[i].series==1){
							str +=  '<div class="yiji">'+
							        		'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red; font-size:6px;"> '+data.data[i].ownusername+'  '+data.data[i].starts +'：</span><span id="">'+data.data[i].content+'</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="huifu111" replyuserid="'+data.data[i].ownuserid+'" replyusername="'+data.data[i].ownusername+'" >回复</span><br />'+
							        	'</div>' 
						}else{
							str += 	'<div class="erji">'+
						        		'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red; font-size:6px;">'+data.data[i].ownusername+' 回复 '+data.data[i].replyusername+data.data[i].starts +'：</span><span id="">'+data.data[i].content+'</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="huifu222" replyuserid="'+data.data[i].ownuserid+'" replyusername="'+data.data[i].ownusername+'">回复</span>'+
						        	'</div>'
						}
					}
					
					$("#liuyan").html(str);
				}else{
					layer.msg(data.msg); 
				}
			}
		});
		
		
		//留言的点击事件
		$("#liuyan111").click(function(){
			layer.alert('<div class="layui-form-item layui-row layui-col-xs12">'+
						'<label class="layui-form-label">留言内容</label>'+
						'<div class="layui-input-block">'+
						'<input type="text" name="jine" class="layui-input jine" lay-verify="required" placeholder="请输入留言内容">'+
						'</div>'+
						'</div>', {
					skin: 'layui-layer-molv' //样式类名  自定义样式
      				,closeBtn: 1    // 是否显示关闭按钮
      				,anim: 2 //动画类型
      				,btn: ['留言','取消'] //按钮
      				,icon: 6    // icon
      				,yes:function(){
      					//获取到值，修改数据库
         				 layer.msg($(".jine").val())
         				 $.ajax({
							type:"post",
							url:"http://127.0.0.1/yh/insertMessage",
							async:true,
							data:{  "ownuserid":userid,
									"replyuserid":0,
									"ownusername":sessionStorage.getItem("userName"),
									"replyusername":"无",
									"guitarinfoid":guitarid,
									"series":1,
									"content":$(".jine").val(),
									"guitarinfoname":guitarname
							},
							dataType:"json",
							success:function(data){
								if(data.code==0){
									layer.msg(data.msg, {
 										icon: 1,
			  							time: 200 //2秒关闭（如果不配置，默认是3秒）
									}, function(){
			  								setTimeout('window.location.reload()',200);
									}); 									
								}else{
									layer.msg(data.msg)
								}
							}
						});
         				
      				}
     				,btn2:function(){
        				 layer.msg('已取消')
     				}
    		});
		})
		
//		//回复的点击事件
		$("#liuyan").delegate(".huifu111","click",function(){
			var replyuserid = $(this).attr('replyuserid');
			var replyusername = $(this).attr('replyusername');
			alert(replyuserid);alert(replyusername);
			layer.alert('<div class="layui-form-item layui-row layui-col-xs12">'+
						'<label class="layui-form-label">留言内容</label>'+
						'<div class="layui-input-block">'+
						'<input type="text" name="jine" class="layui-input jine" lay-verify="required" placeholder="请输入留言内容">'+
						'</div>'+
						'</div>', {
					skin: 'layui-layer-molv' //样式类名  自定义样式
      				,closeBtn: 1    // 是否显示关闭按钮
      				,anim: 2 //动画类型
      				,btn: ['留言','取消'] //按钮
      				,icon: 6    // icon
      				,yes:function(){
      					//获取到值，修改数据库
         				 layer.msg($(".jine").val())
         				 $.ajax({
							type:"post",
							url:"http://127.0.0.1/yh/insertMessage",
							async:true,
							data:{  "ownuserid":userid,
									"replyuserid":replyuserid,
									"ownusername":sessionStorage.getItem("userName"),
									"replyusername":replyusername,
									"guitarinfoid":guitarid,
									"series":2,
									"content":$(".jine").val(),
									"guitarinfoname":guitarname
							},
							dataType:"json",
							success:function(data){
								if(data.code==0){
									layer.msg(data.msg, {
 										icon: 1,
			  							time: 200 //2秒关闭（如果不配置，默认是3秒）
									}, function(){
			  								setTimeout('window.location.reload()',200);
									}); 									
								}else{
									layer.msg(data.msg)
								}
							}
						});
         				
      				}
     				,btn2:function(){
        				 layer.msg('已取消')
     				}
    		});
		})
//		
//		//回复回复点击事件
		$("#liuyan").delegate(".huifu222","click",function(){
			var replyuserid = $(this).attr('replyuserid');
			var replyusername = $(this).attr('replyusername');
			alert(replyuserid);alert(replyusername);
			layer.alert('<div class="layui-form-item layui-row layui-col-xs12">'+
						'<label class="layui-form-label">留言内容</label>'+
						'<div class="layui-input-block">'+
						'<input type="text" name="jine" class="layui-input jine" lay-verify="required" placeholder="请输入留言内容">'+
						'</div>'+
						'</div>', {
					skin: 'layui-layer-molv' //样式类名  自定义样式
      				,closeBtn: 1    // 是否显示关闭按钮
      				,anim: 2 //动画类型
      				,btn: ['留言','取消'] //按钮
      				,icon: 6    // icon
      				,yes:function(){
      					//获取到值，修改数据库
         				 layer.msg($(".jine").val())
         				 $.ajax({
							type:"post",
							url:"http://127.0.0.1/yh/insertMessage",
							async:true,
							data:{  "ownuserid":userid,
									"replyuserid":replyuserid,
									"ownusername":sessionStorage.getItem("userName"),
									"replyusername":replyusername,
									"guitarinfoid":guitarid,
									"series":3,
									"content":$(".jine").val(),
									"guitarinfoname":guitarname
							},
							dataType:"json",
							success:function(data){
								if(data.code==0){
									layer.msg(data.msg, {
 										icon: 1,
			  							time: 200 //2秒关闭（如果不配置，默认是3秒）
									}, function(){
			  								setTimeout('window.location.reload()',200);
									}); 									
								}else{
									layer.msg(data.msg)
								}
							}
						});
         				
      				}
     				,btn2:function(){
        				 layer.msg('已取消')
     				}
    		});
		})
	
</script>


</html>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  